package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AdminUserFlowingMapper;
import com.ruoyi.system.domain.AdminUserFlowing;
import com.ruoyi.system.service.IAdminUserFlowingService;

/**
 * 用户流水记录Service业务层处理
 *
 * @author ruoyi
 * @date 2020-11-13
 */
@Service
public class AdminUserFlowingServiceImpl implements IAdminUserFlowingService
{
    @Autowired
    private AdminUserFlowingMapper adminUserFlowingMapper;

    /**
     * 查询用户流水记录
     *
     * @param id 用户流水记录ID
     * @return 用户流水记录
     */
    @Override
    public AdminUserFlowing selectAdminUserFlowingById(Long id)
    {
        return adminUserFlowingMapper.selectAdminUserFlowingById(id);
    }

    @Override
    public AdminUserFlowing selectAdminUserFlowingByBetId(Long betId) {
        return adminUserFlowingMapper.selectAdminUserFlowingByBetId(betId);
    }

    /**
     * 查询用户流水记录列表
     *
     * @param adminUserFlowing 用户流水记录
     * @return 用户流水记录
     */
    @Override
    public List<AdminUserFlowing> selectAdminUserFlowingList(AdminUserFlowing adminUserFlowing)
    {
        return adminUserFlowingMapper.selectAdminUserFlowingList(adminUserFlowing);
    }

    /**
     * 新增用户流水记录
     *
     * @param adminUserFlowing 用户流水记录
     * @return 结果
     */
    @Override
    public int insertAdminUserFlowing(AdminUserFlowing adminUserFlowing)
    {
        adminUserFlowing.setCreateTime(DateUtils.getNowDate());
        return adminUserFlowingMapper.insertAdminUserFlowing(adminUserFlowing);
    }

    /**
     * 修改用户流水记录
     *
     * @param adminUserFlowing 用户流水记录
     * @return 结果
     */
    @Override
    public int updateAdminUserFlowing(AdminUserFlowing adminUserFlowing)
    {
        adminUserFlowing.setUpdateTime(DateUtils.getNowDate());
        return adminUserFlowingMapper.updateAdminUserFlowing(adminUserFlowing);
    }

    /**
     * 批量删除用户流水记录
     *
     * @param ids 需要删除的用户流水记录ID
     * @return 结果
     */
    @Override
    public int deleteAdminUserFlowingByIds(Long[] ids)
    {
        return adminUserFlowingMapper.deleteAdminUserFlowingByIds(ids);
    }

    /**
     * 删除用户流水记录信息
     *
     * @param id 用户流水记录ID
     * @return 结果
     */
    @Override
    public int deleteAdminUserFlowingById(Long id)
    {
        return adminUserFlowingMapper.deleteAdminUserFlowingById(id);
    }

    @Override
    public int deleteAdminUserFlowingByRoomAndPeriod(@Param("room") String room,@Param("period") Long period) {
        return adminUserFlowingMapper.deleteAdminUserFlowingByRoomAndPeriod(room,period);
    }

    @Override
    public int deleteAdminUserFlowingByRoomAndPriceAndWeixinId(AdminUserFlowing adminUserFlowing) {
        return adminUserFlowingMapper.deleteAdminUserFlowingByRoomAndPriceAndWeixinId(adminUserFlowing);
    }
}
